package com.ruoyi.ax.service.impl;

import java.util.List;

import com.ruoyi.ax.service.IAxGoodService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ax.mapper.AxRoundMapper;
import com.ruoyi.ax.domain.AxRound;
import com.ruoyi.ax.service.IAxRoundService;

/**
 * 场次管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-07
 */
@Service
public class AxRoundServiceImpl implements IAxRoundService 
{
    @Autowired
    private AxRoundMapper axRoundMapper;

    @Autowired
    private IAxGoodService axGoodService;

    /**
     * 查询场次管理
     * 
     * @param id 场次管理主键
     * @return 场次管理
     */
    @Override
    public AxRound selectAxRoundById(Long id)
    {
        AxRound axRound =axRoundMapper.selectAxRoundById(id);
        // axRound.setAxGood(axGoodService.selectAxGoodById(Long.valueOf(axRound.getGoodId())));
        return axRound;
    }


    /**
     * 简易查询场次只查询列表
     *
     * @param axRound 场次管理
     * @return 场次管理
     */
    @Override
    public List<AxRound> selectAxRoundClassList(AxRound axRound)
    {
        List<AxRound> list= axRoundMapper.selectAxRoundList(axRound);
        return list;
    }


    /**
     * 查询场次管理列表
     * 
     * @param axRound 场次管理
     * @return 场次管理
     */
    @Override
    public List<AxRound> selectAxRoundList(AxRound axRound)
    {
        List<AxRound> list= axRoundMapper.selectAxRoundList(axRound);
        for(AxRound axRound1:list){
           // axRound1.setAxGood(axGoodService.selectAxGoodById(Long.valueOf(axRound1.getGoodId())));
        }
        return list;
    }

    /**
     * 新增场次管理
     * 
     * @param axRound 场次管理
     * @return 结果
     */
    @Override
    public int insertAxRound(AxRound axRound)
    {
        axRound.setCreateTime(DateUtils.getNowDate());
        return axRoundMapper.insertAxRound(axRound);
    }

    /**
     * 修改场次管理
     * 
     * @param axRound 场次管理
     * @return 结果
     */
    @Override
    public int updateAxRound(AxRound axRound)
    {
        axRound.setUpdateTime(DateUtils.getNowDate());
        return axRoundMapper.updateAxRound(axRound);
    }

    /**
     * 批量删除场次管理
     * 
     * @param ids 需要删除的场次管理主键
     * @return 结果
     */
    @Override
    public int deleteAxRoundByIds(Long[] ids)
    {
        return axRoundMapper.deleteAxRoundByIds(ids);
    }

    /**
     * 删除场次管理信息
     * 
     * @param id 场次管理主键
     * @return 结果
     */
    @Override
    public int deleteAxRoundById(Long id)
    {
        return axRoundMapper.deleteAxRoundById(id);
    }
}
